package com.kitty.mina.filter;


import com.kitty.common.utils.ConcurrentHashSet;

public class NetGateKeeper {

    private static NetGateKeeper instance = new NetGateKeeper();

    /**
     * 暂时受限的协议列表
     */
    private ConcurrentHashSet<String> forbidProcotols = new ConcurrentHashSet<>();

    public static NetGateKeeper getInstance() {
        return instance;
    }

    public void openProcotol(String messageId) {
        forbidProcotols.add(messageId);
    }

    public void closeProcotol(String messageId) {
        forbidProcotols.add(messageId);
    }

    public boolean canVisit(String messageId) {
        return !forbidProcotols.contains(messageId);
    }

}
